<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 可选链操作符  ?.
    let obj = {
      a: {
        b: {
          c: {
            d: 100
          }
        }
      }
    };

    // obj.b && obj.b.c

    // obj.a.b.c.d
    let result = obj?.b?.c
    console.log(result);


  </script>
</body>
</html>